package day1207_4;
class  Dog{//表示狗类  //private私有的
    private int  age;//private表示age只能在Dog里边用
    private String name;
    private char  color;
    public  int  getAge(){
        return age;//返回age变量的值
    }
    //通过公有方法访问变量ublic
    public  void setAge(int a){
        age=a;
    }


}

public class T1 {

    public static void main(String[] args) {
        Dog  wc=new Dog();
        wc.setAge(2);
        System.out.println(wc.getAge());
    }
}







